-widget_title = "Related to " + instance.class.to_s.titleize if local_assigns[:widget_title].nil?

-near_model = instance.class.to_s
-near_model = "Process" if near_model == "System" && instance.is_biz_process?

-models = related_objects(instance)
-#left_models, right_models = arranged_related_objects(instance)

-content_for :widget_title do
  =widget_title

-content_for :widget_id, "related_widget"

-content_for :widget_help, 'related'
#related.open
  .row-fluid
    .span12
      .tabbable
        %ul.nav.nav-tabs
          -models.delete('Risk').each do |model|
            -table_name = model.underscore.pluralize #.table_name
            -icon = "grcicon-#{model.downcase}-color"
            %li{:class => "tab-btn text-#{model.downcase}"}
              %a{:href => "#related-#{table_name}-pane",
                "data-toggle" => 'tab',
                "data-source" => related_objects_flow_relationships_path(:oid => instance.id,
                  :otype => near_model,
                  :related_model => model),
                "data-template" => "/assets/related.mustache",
                "data-refresh-time" => 60 }
                %i{:class => icon }
                %span.collapse_tab_text
                  #{table_name.titleize} 
                #{' ' + instance.count_other_objects(model).to_s}
  .tab-content
    -models.each do |model|
      .tab-pane{:id => "related-#{model.underscore.pluralize}-pane"}
        Data for #{model.titleize}
